home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / pas_all.zip / TI182.ASC < prev    next >
Text File  |  1991-09-11  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.   PRODUCT : TURBO PASCAL                               NUMBER : 182
  10.   VERSION : ALL
  11.        OS : PC-DOS
  12.      DATE : March 13, 1986                               PAGE : 1/2
  13.     TITLE : CURSOR DEFINITION
  14.  
  15.  
  16.  
  17.  
  18.   This sample program demonstrates how to  modify the cursor.
  19.  
  20.   program Cursor;
  21.   var
  22.        ch     : char;
  23.        Start,
  24.        EndCur : integer;
  25.  
  26.   procedure SetCursor(StartLine, Endline : integer);
  27.   { This procedure does the actual cursor setting thru the }
  28.   { Turbo Intr procedure                                   }
  29.   type
  30.     Registers =  record
  31.                    AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags: integer;
  32.                  end;
  33.   var
  34.         RegPack    :  Registers;
  35.         CxRegArray :  array[1..2] of byte;
  36.         CXReg      :  integer absolute CXRegArray;
  37.   begin
  38.     CXRegArray[2] := Lo(StartLine);
  39.     CXRegArray[1] := Lo(EndLine);
  40.     with RegPack do
  41.     begin
  42.       AX := $0100;             {ah = 1 means set cursor type         }
  43.       BX := $0;                {bx = page number, zero for us        }
  44.       CX := CXReg;             {ch bits 4 to 0 = start line for      }
  45.                                {Cursor cl bits 4 to 0 = end line for }
  46.                                {cursor                               }
  47.       Intr($10, RegPack);      {set cursor                           }
  48.     end;
  49.   end;
  50.  
  51.   Procedure BoxCursor;
  52.   { This procedure calls SetCursor to show a block (box) cursor }
  53.   begin
  54.     SetCursor(0, 12);
  55.   end;  { BoxCursor }
  56.  
  57.   Procedure NoCursor;
  58.   { This procedure calls SetCursor to turn the cursor off }
  59.   begin
  60.     SetCursor(32, 0);
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.   PRODUCT : TURBO PASCAL                               NUMBER : 182
  76.   VERSION : ALL
  77.        OS : PC-DOS
  78.      DATE : March 13, 1986                               PAGE : 2/2
  79.     TITLE : CURSOR DEFINITION
  80.  
  81.  
  82.  
  83.  
  84.   end;  { NoCursor }
  85.  
  86.   Procedure ULCursorColor;
  87.   { This procedure calls SetCursor to show the underscore cursor on}
  88.   { a color monitor                                                }
  89.   begin
  90.     SetCursor(6, 7);
  91.   end;  { ULCursor }
  92.  
  93.   Procedure ULCursorMono;
  94.   { This procedure calls SetCursor to show the underscore cursor }
  95.   { on a monochrome monitor                                      }
  96.   begin
  97.     SetCursor(11, 12);
  98.   end;  { ULCursor }
  99.  
  100.   begin
  101.     ClrScr;
  102.     write('BOX      :'); BoxCursor;      readln;
  103.     write('NO       :'); NoCursor;       readln;
  104.     write('UL Color :'); ULCursorColor;  readln;
  105.     write('UL Mono  :'); ULCursorMono;   readln;
  106.   end.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.